// httpServer.js
let express = require('express')
let app = express()

app.all('*', (req, res, next) => {
  res.header('Access-Control-Allow-Origin', '*')
  res.header('Content-Type', 'application/json;charset=utf-8')
  next()
})

app.get('/', (req, res) => {
  res.send('首页')
})

app.get('/get/info', (req, res) => {
  res.send({
    code: 200,
    data: {
      sunny: '阳光'
    }
  })
})

app.listen(3000, () => {
  console.log('服务器启动成功...')
})
